package com.demo.dao;

import com.demo.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Description: UserMapper
 * @Author: ChenXueLi
 * @Date: 2018-10-02 11:02
 */
//@Repository
@Mapper
public interface UserMapper {

    /**
     * 添加用户
     * @param user
     * @return
     */
    int addUser(User user);

    /**
     * 删除用户
     * @param user
     * @return
     */
    int deleteUser(User user);

    /**
     * 更新用户
     * @param user
     * @return
     */
    int updateUser(User user);

    /**
     * 根据id查询用户信息
     * @param userId
     * @return
     */
    User getUserById(@Param("userId")Integer userId);

    /**
     * 查询用户列表
     * @param map
     * @return
     */
    List<User> getUserList(Map map);

}
